<!DOCTYPE html>
<html>
    <head>
        <title>demo</title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <style>
            body {
                font-family: Monospace;
                background-color: #f0f0f0;
                margin: 0px;
                overflow: hidden;
            }
        </style>
    </head>
    <body>
        <script src="https://cdn.bootcdn.net/ajax/libs/three.js/73/three.js"></script>
        <script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
        <script src="https://cdn.bootcdn.net/ajax/libs/tween.js/0.11.0/Tween.min.js"></script>
		<script src="https://unpkg.com/three@0.73.1/examples/js/controls/TrackballControls.js"></script>
        <script src="https://cdn.bootcdn.net/ajax/libs/stats.js/10/Stats.min.js"></script>
        <script>

            var jsonstr = '[{"boxId":"94267810103W428","x":-65.900002,"y":-23.250000,"z":-536.000000,"width":100.000000,"height":213.500000,"length":120.000000,"weight":303.600006,"platform":"platform34","order":1,"material":"","type":1,"place":100},{"boxId":"94267810103W429","x":34.099998,"y":-23.250000,"z":-536.000000,"width":100.000000,"height":213.500000,"length":120.000000,"weight":303.600006,"platform":"platform34","order":2,"material":"","type":1,"place":100},{"boxId":"94267810103W430","x":-65.900002,"y":-23.250000,"z":-416.000000,"width":100.000000,"height":213.500000,"length":120.000000,"weight":303.600006,"platform":"platform34","order":3,"material":"","type":1,"place":100},{"boxId":"94267810103W431","x":34.099998,"y":-23.250000,"z":-416.000000,"width":100.000000,"height":213.500000,"length":120.000000,"weight":303.600006,"platform":"platform34","order":4,"material":"","type":1,"place":100},{"boxId":"94267810103W432","x":-92.900002,"y":96.000000,"z":-561.500000,"width":46.000000,"height":25.000000,"length":69.000000,"weight":11.200000,"platform":"platform34","order":5,"material":"","type":1,"place":100},{"boxId":"94267810103W433","x":-46.900002,"y":96.000000,"z":-561.500000,"width":46.000000,"height":25.000000,"length":69.000000,"weight":11.200000,"platform":"platform34","order":6,"material":"","type":1,"place":100},{"boxId":"94267810103W434","x":-0.900000,"y":96.000000,"z":-561.500000,"width":46.000000,"height":25.000000,"length":69.000000,"weight":11.200000,"platform":"platform34","order":7,"material":"","type":1,"place":100},{"boxId":"94267810103W435","x":45.099998,"y":96.000000,"z":-561.500000,"width":46.000000,"height":25.000000,"length":69.000000,"weight":11.200000,"platform":"platform34","order":8,"material":"","type":1,"place":100},{"boxId":"94267810103U813","x":-35.900002,"y":-91.750000,"z":-317.500000,"width":77.000000,"height":76.500000,"length":160.000000,"weight":70.000000,"platform":"platform34","order":9,"material":"","type":1,"place":200},{"boxId":"94267810103U814","x":-78.400002,"y":-22.000000,"z":-318.500000,"width":75.000000,"height":63.000000,"length":75.000000,"weight":20.000000,"platform":"platform34","order":10,"material":"","type":1,"place":100},{"boxId":"94267810102Y844","x":-73.800003,"y":102.500000,"z":-499.899994,"width":54.200001,"height":38.000000,"length":84.199997,"weight":16.500000,"platform":"platform08","order":11,"material":"","type":1,"place":200},{"boxId":"94267810103R833","x":-11.950000,"y":100.750000,"z":-507.250000,"width":39.500000,"height":34.500000,"length":39.500000,"weight":4.350000,"platform":"platform08","order":12,"material":"","type":1,"place":100},{"boxId":"94267810103Q967","x":26.549999,"y":101.000000,"z":-508.250000,"width":37.500000,"height":35.000000,"length":37.500000,"weight":3.650000,"platform":"platform08","order":13,"material":"","type":1,"place":100},{"boxId":"94267810103Q922","x":-0.900000,"y":-11.000000,"z":-326.000000,"width":60.000000,"height":85.000000,"length":80.000000,"weight":35.500000,"platform":"platform08","order":14,"material":"","type":1,"place":200},{"boxId":"94267810103U668","x":-55.900002,"y":-74.000000,"z":-239.000000,"width":80.000000,"height":112.000000,"length":120.000000,"weight":162.500000,"platform":"platform08","order":15,"material":"","type":1,"place":200},{"boxId":"94267810103U669","x":-55.900002,"y":38.000000,"z":-239.000000,"width":80.000000,"height":112.000000,"length":120.000000,"weight":162.500000,"platform":"platform08","order":16,"material":"","type":1,"place":200},{"boxId":"94267810103F749","x":42.599998,"y":-103.000000,"z":-240.500000,"width":77.000000,"height":54.000000,"length":77.000000,"weight":39.000000,"platform":"platform08","order":17,"material":"","type":1,"place":100},{"boxId":"94267810103U667","x":-55.900002,"y":-92.250000,"z":-159.000000,"width":80.000000,"height":75.500000,"length":120.000000,"weight":95.000000,"platform":"platform08","order":18,"material":"","type":1,"place":200},{"boxId":"94267810103T894","x":27.100000,"y":91.500000,"z":-449.799988,"width":46.000000,"height":16.000000,"length":46.000000,"weight":33.540001,"platform":"platform05","order":19,"material":"","type":1,"place":100},{"boxId":"94267810103T933","x":-58.400002,"y":3.000000,"z":-162.000000,"width":74.000000,"height":115.000000,"length":115.000000,"weight":567.000000,"platform":"platform05","order":20,"material":"","type":1,"place":200},{"boxId":"94267810103Q395","x":45.349998,"y":-87.500000,"z":-167.750000,"width":62.500000,"height":85.000000,"length":82.500000,"weight":116.000000,"platform":"platform03","order":21,"material":"","type":1,"place":200},{"boxId":"94267810103R358","x":-55.799999,"y":-69.800003,"z":-78.900002,"width":80.199997,"height":120.400002,"length":120.199997,"weight":399.000000,"platform":"platform03","order":22,"material":"","type":1,"place":200},{"boxId":"94267810103T836","x":-55.849998,"y":50.500000,"z":-78.949997,"width":80.099998,"height":120.199997,"length":120.099998,"weight":387.500000,"platform":"platform03","order":23,"material":"","type":1,"place":200},{"boxId":"94267810103T837","x":-56.000000,"y":-69.800003,"z":1.100000,"width":79.800003,"height":120.400002,"length":119.800003,"weight":387.000000,"platform":"platform03","order":24,"material":"","type":1,"place":200},{"boxId":"94267810103D600","x":-55.900002,"y":-70.050003,"z":80.949997,"width":79.900002,"height":119.900002,"length":120.000000,"weight":388.500000,"platform":"platform03","order":25,"material":"","type":1,"place":200},{"boxId":"94267810103E090","x":-58.650002,"y":-67.650002,"z":269.950012,"width":114.500000,"height":124.699997,"length":298.100006,"weight":643.000000,"platform":"platform03","order":26,"material":"","type":1,"place":100},{"boxId":"94267810103U405","x":56.549999,"y":113.250000,"z":-577.250000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":2.780000,"platform":"platform09","order":27,"material":"","type":1,"place":100},{"boxId":"94267810103S960","x":56.549999,"y":122.750000,"z":-577.250000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":2.360000,"platform":"platform09","order":28,"material":"","type":1,"place":100},{"boxId":"94267810103U648","x":-12.450000,"y":123.000000,"z":-509.250000,"width":35.500000,"height":10.000000,"length":38.500000,"weight":4.760000,"platform":"platform09","order":29,"material":"","type":1,"place":200},{"boxId":"94267810103T878","x":26.549999,"y":123.250000,"z":-515.750000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":1.050000,"platform":"platform09","order":30,"material":"","type":1,"place":200},{"boxId":"94267810103U393","x":61.349998,"y":88.250000,"z":-508.250000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":1.000000,"platform":"platform09","order":31,"material":"","type":1,"place":100},{"boxId":"94267810103T749","x":61.349998,"y":97.750000,"z":-508.250000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":0.780000,"platform":"platform09","order":32,"material":"","type":1,"place":100},{"boxId":"94267810103S746","x":61.349998,"y":107.250000,"z":-508.250000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":0.660000,"platform":"platform09","order":33,"material":"","type":1,"place":100},{"boxId":"94267810103S735","x":61.349998,"y":116.750000,"z":-508.250000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":0.600000,"platform":"platform09","order":34,"material":"","type":1,"place":100},{"boxId":"94267810103T065","x":22.950001,"y":111.250000,"z":-454.549988,"width":36.500000,"height":23.500000,"length":37.500000,"weight":7.660000,"platform":"platform09","order":35,"material":"","type":1,"place":200},{"boxId":"94267810103S736","x":43.450001,"y":102.750000,"z":-406.549988,"width":40.500000,"height":38.500000,"length":78.500000,"weight":32.500000,"platform":"platform09","order":36,"material":"","type":1,"place":200},{"boxId":"94267810103S988","x":23.700001,"y":47.000000,"z":-326.500000,"width":39.000000,"height":31.000000,"length":59.000000,"weight":3.340000,"platform":"platform09","order":37,"material":"","type":1,"place":100},{"boxId":"94267810103D746","x":22.950001,"y":74.250000,"z":-337.750000,"width":36.500000,"height":23.500000,"length":37.500000,"weight":1.750000,"platform":"platform09","order":38,"material":"","type":1,"place":200},{"boxId":"94267810103S061","x":22.950001,"y":97.750000,"z":-337.750000,"width":36.500000,"height":23.500000,"length":37.500000,"weight":1.720000,"platform":"platform09","order":39,"material":"","type":1,"place":200},{"boxId":"94267810103S775","x":23.450001,"y":114.500000,"z":-338.250000,"width":35.500000,"height":10.000000,"length":38.500000,"weight":2.900000,"platform":"platform09","order":40,"material":"","type":1,"place":200},{"boxId":"94267810103T071","x":44.299999,"y":-3.300000,"z":-169.000000,"width":60.000000,"height":83.400002,"length":80.000000,"weight":55.500000,"platform":"platform09","order":41,"material":"","type":1,"place":200},{"boxId":"94267810102Y360","x":44.299999,"y":80.099998,"z":-169.000000,"width":60.000000,"height":83.400002,"length":80.000000,"weight":54.000000,"platform":"platform09","order":42,"material":"","type":1,"place":200},{"boxId":"94267810103S987","x":34.299999,"y":-88.250000,"z":-79.000000,"width":60.000000,"height":83.500000,"length":80.000000,"weight":33.500000,"platform":"platform09","order":43,"material":"","type":1,"place":100},{"boxId":"94267810103S055","x":34.299999,"y":-5.200000,"z":-79.000000,"width":60.000000,"height":82.599998,"length":80.000000,"weight":41.000000,"platform":"platform09","order":44,"material":"","type":1,"place":100},{"boxId":"94267810103W019","x":24.400000,"y":63.599998,"z":-79.900002,"width":40.200001,"height":55.000000,"length":78.199997,"weight":33.000000,"platform":"platform09","order":45,"material":"","type":1,"place":100},{"boxId":"94267810103T459","x":24.549999,"y":110.349998,"z":-79.750000,"width":40.500000,"height":38.500000,"length":78.500000,"weight":10.000000,"platform":"platform09","order":46,"material":"","type":1,"place":100},{"boxId":"94267810103S869","x":84.400002,"y":-102.500000,"z":-79.900002,"width":40.200001,"height":55.000000,"length":78.199997,"weight":23.000000,"platform":"platform09","order":47,"material":"","type":1,"place":100},{"boxId":"94267810103T886","x":84.400002,"y":-47.500000,"z":-79.900002,"width":40.200001,"height":55.000000,"length":78.199997,"weight":15.000000,"platform":"platform09","order":48,"material":"","type":1,"place":100},{"boxId":"94267810103S048","x":84.400002,"y":7.500000,"z":-79.900002,"width":40.200001,"height":55.000000,"length":78.199997,"weight":7.500000,"platform":"platform09","order":49,"material":"","type":1,"place":100},{"boxId":"94267810103S049","x":59.099998,"y":-86.900002,"z":16.200001,"width":110.000000,"height":86.199997,"length":110.000000,"weight":74.000000,"platform":"platform09","order":50,"material":"","type":1,"place":100},{"boxId":"94267810103S745","x":50.099998,"y":-1.050000,"z":7.200000,"width":92.000000,"height":85.500000,"length":92.000000,"weight":58.500000,"platform":"platform09","order":51,"material":"","type":1,"place":100},{"boxId":"94267790100T481","x":42.599998,"y":82.000000,"z":-0.300000,"width":77.000000,"height":80.599998,"length":77.000000,"weight":59.500000,"platform":"platform09","order":52,"material":"","type":1,"place":100},{"boxId":"94267810103S777","x":-77.400002,"y":24.750000,"z":159.399994,"width":77.000000,"height":60.099998,"length":77.000000,"weight":96.000000,"platform":"platform09","order":53,"material":"","type":1,"place":100},{"boxId":"94267810103U812","x":-77.400002,"y":81.800003,"z":159.399994,"width":77.000000,"height":54.000000,"length":77.000000,"weight":59.500000,"platform":"platform09","order":54,"material":"","type":1,"place":100},{"boxId":"94267810103S870","x":-77.400002,"y":19.049999,"z":236.399994,"width":77.000000,"height":48.700001,"length":77.000000,"weight":38.000000,"platform":"platform09","order":55,"material":"","type":1,"place":100},{"boxId":"94267810103S045","x":-77.400002,"y":67.400002,"z":236.399994,"width":77.000000,"height":48.000000,"length":77.000000,"weight":40.500000,"platform":"platform09","order":56,"material":"","type":1,"place":100},{"boxId":"94267810103T394","x":-98.650002,"y":115.349998,"z":-106.250000,"width":25.500000,"height":9.500000,"length":34.500000,"weight":1.000000,"platform":"platform04","order":57,"material":"","type":1,"place":200},{"boxId":"94267810103U888","x":44.099998,"y":-95.000000,"z":95.199997,"width":48.000000,"height":70.000000,"length":80.000000,"weight":66.000000,"platform":"platform04","order":58,"material":"","type":1,"place":200},{"boxId":"94267810103U889","x":44.099998,"y":-25.000000,"z":95.199997,"width":48.000000,"height":70.000000,"length":80.000000,"weight":66.000000,"platform":"platform04","order":59,"material":"","type":1,"place":200},{"boxId":"94267810103S342","x":44.099998,"y":45.000000,"z":95.199997,"width":48.000000,"height":70.000000,"length":80.000000,"weight":65.800003,"platform":"platform04","order":60,"material":"","type":1,"place":200},{"boxId":"94267810103S393","x":27.700001,"y":103.500000,"z":93.800003,"width":45.200001,"height":47.000000,"length":47.200001,"weight":8.100000,"platform":"platform04","order":61,"material":"","type":1,"place":200},{"boxId":"94267810103S343","x":-75.900002,"y":29.700001,"z":298.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":65.400002,"platform":"platform04","order":62,"material":"","type":1,"place":200},{"boxId":"94267810103S352","x":-75.900002,"y":29.700001,"z":346.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":65.199997,"platform":"platform04","order":63,"material":"","type":1,"place":200},{"boxId":"94267810103S353","x":-75.900002,"y":29.700001,"z":394.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":65.199997,"platform":"platform04","order":64,"material":"","type":1,"place":200},{"boxId":"94267810103U891","x":-75.900002,"y":90.199997,"z":298.899994,"width":48.000000,"height":51.000000,"length":80.000000,"weight":47.000000,"platform":"platform04","order":65,"material":"","type":1,"place":200},{"boxId":"94267810103U890","x":-75.900002,"y":90.199997,"z":346.899994,"width":48.000000,"height":51.000000,"length":80.000000,"weight":46.000000,"platform":"platform04","order":66,"material":"","type":1,"place":200},{"boxId":"94267810103S350","x":22.600000,"y":-95.000000,"z":160.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":65.000000,"platform":"platform04","order":67,"material":"","type":1,"place":100},{"boxId":"94267810103S363","x":70.599998,"y":-95.000000,"z":160.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":65.000000,"platform":"platform04","order":68,"material":"","type":1,"place":100},{"boxId":"94267810103S348","x":22.600000,"y":-95.000000,"z":240.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":64.800003,"platform":"platform04","order":69,"material":"","type":1,"place":100},{"boxId":"94267810103S354","x":70.599998,"y":-95.000000,"z":240.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":64.800003,"platform":"platform04","order":70,"material":"","type":1,"place":100},{"boxId":"94267810103S362","x":22.600000,"y":-95.000000,"z":320.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":64.800003,"platform":"platform04","order":71,"material":"","type":1,"place":100},{"boxId":"94267810103S365","x":70.599998,"y":-95.000000,"z":320.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":64.800003,"platform":"platform04","order":72,"material":"","type":1,"place":100},{"boxId":"94267810103S367","x":22.600000,"y":-95.000000,"z":400.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":64.800003,"platform":"platform04","order":73,"material":"","type":1,"place":100},{"boxId":"94267810103S344","x":70.599998,"y":-95.000000,"z":400.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":64.599998,"platform":"platform04","order":74,"material":"","type":1,"place":100},{"boxId":"94267810103T714","x":22.600000,"y":-95.000000,"z":480.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":64.400002,"platform":"platform04","order":75,"material":"","type":1,"place":100},{"boxId":"94267810103S349","x":70.599998,"y":-95.000000,"z":480.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":64.400002,"platform":"platform04","order":76,"material":"","type":1,"place":100},{"boxId":"94267810103S351","x":22.600000,"y":-25.000000,"z":160.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":64.400002,"platform":"platform04","order":77,"material":"","type":1,"place":100},{"boxId":"94267810103T715","x":70.599998,"y":-25.000000,"z":160.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":64.199997,"platform":"platform04","order":78,"material":"","type":1,"place":100},{"boxId":"94267810103S355","x":22.600000,"y":-25.000000,"z":240.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":64.199997,"platform":"platform04","order":79,"material":"","type":1,"place":100},{"boxId":"94267810103S358","x":70.599998,"y":-25.000000,"z":240.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":64.199997,"platform":"platform04","order":80,"material":"","type":1,"place":100},{"boxId":"94267810103S364","x":22.600000,"y":-25.000000,"z":320.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":64.199997,"platform":"platform04","order":81,"material":"","type":1,"place":100},{"boxId":"94267810103S341","x":70.599998,"y":-25.000000,"z":320.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":64.000000,"platform":"platform04","order":82,"material":"","type":1,"place":100},{"boxId":"94267810103S359","x":22.600000,"y":-25.000000,"z":400.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":64.000000,"platform":"platform04","order":83,"material":"","type":1,"place":100},{"boxId":"94267810103S368","x":70.599998,"y":-25.000000,"z":400.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":64.000000,"platform":"platform04","order":84,"material":"","type":1,"place":100},{"boxId":"94267810103T706","x":22.600000,"y":-25.000000,"z":480.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":63.799999,"platform":"platform04","order":85,"material":"","type":1,"place":100},{"boxId":"94267810103T716","x":70.599998,"y":-25.000000,"z":480.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":63.799999,"platform":"platform04","order":86,"material":"","type":1,"place":100},{"boxId":"94267810103S340","x":22.600000,"y":45.000000,"z":160.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":63.799999,"platform":"platform04","order":87,"material":"","type":1,"place":100},{"boxId":"94267810103S345","x":70.599998,"y":45.000000,"z":160.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":63.799999,"platform":"platform04","order":88,"material":"","type":1,"place":100},{"boxId":"94267810103S347","x":22.600000,"y":45.000000,"z":240.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":63.799999,"platform":"platform04","order":89,"material":"","type":1,"place":100},{"boxId":"94267810103S357","x":70.599998,"y":45.000000,"z":240.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":63.799999,"platform":"platform04","order":90,"material":"","type":1,"place":100},{"boxId":"94267810103S360","x":22.600000,"y":45.000000,"z":320.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":63.799999,"platform":"platform04","order":91,"material":"","type":1,"place":100},{"boxId":"94267810103T709","x":70.599998,"y":45.000000,"z":320.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":63.599998,"platform":"platform04","order":92,"material":"","type":1,"place":100},{"boxId":"94267810103T710","x":22.600000,"y":45.000000,"z":400.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":63.599998,"platform":"platform04","order":93,"material":"","type":1,"place":100},{"boxId":"94267810103T717","x":70.599998,"y":45.000000,"z":400.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":63.599998,"platform":"platform04","order":94,"material":"","type":1,"place":100},{"boxId":"94267810103T718","x":22.600000,"y":45.000000,"z":480.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":63.599998,"platform":"platform04","order":95,"material":"","type":1,"place":100},{"boxId":"94267810103S339","x":70.599998,"y":45.000000,"z":480.899994,"width":48.000000,"height":70.000000,"length":80.000000,"weight":63.599998,"platform":"platform04","order":96,"material":"","type":1,"place":100},{"boxId":"94267810103S356","x":38.599998,"y":-95.000000,"z":544.900024,"width":48.000000,"height":70.000000,"length":80.000000,"weight":63.599998,"platform":"platform04","order":97,"material":"","type":1,"place":200},{"boxId":"94267810103S361","x":38.599998,"y":-25.000000,"z":544.900024,"width":48.000000,"height":70.000000,"length":80.000000,"weight":63.599998,"platform":"platform04","order":98,"material":"","type":1,"place":200},{"boxId":"94267810103S366","x":38.599998,"y":45.000000,"z":544.900024,"width":48.000000,"height":70.000000,"length":80.000000,"weight":63.599998,"platform":"platform04","order":99,"material":"","type":1,"place":200},{"boxId":"94267810103T712","x":-91.900002,"y":-95.000000,"z":459.000000,"width":48.000000,"height":70.000000,"length":80.000000,"weight":63.400002,"platform":"platform04","order":100,"material":"","type":1,"place":100},{"boxId":"94267810103S338","x":-43.900002,"y":-95.000000,"z":459.000000,"width":48.000000,"height":70.000000,"length":80.000000,"weight":63.400002,"platform":"platform04","order":101,"material":"","type":1,"place":100},{"boxId":"94267810103S346","x":-91.900002,"y":-95.000000,"z":539.000000,"width":48.000000,"height":70.000000,"length":80.000000,"weight":63.400002,"platform":"platform04","order":102,"material":"","type":1,"place":100},{"boxId":"94267810103T702","x":-43.900002,"y":-95.000000,"z":539.000000,"width":48.000000,"height":70.000000,"length":80.000000,"weight":63.200001,"platform":"platform04","order":103,"material":"","type":1,"place":100},{"boxId":"94267810103T705","x":-91.900002,"y":-25.000000,"z":459.000000,"width":48.000000,"height":70.000000,"length":80.000000,"weight":63.200001,"platform":"platform04","order":104,"material":"","type":1,"place":100},{"boxId":"94267810103T719","x":-43.900002,"y":-25.000000,"z":459.000000,"width":48.000000,"height":70.000000,"length":80.000000,"weight":63.200001,"platform":"platform04","order":105,"material":"","type":1,"place":100},{"boxId":"94267810103T713","x":-91.900002,"y":-25.000000,"z":539.000000,"width":48.000000,"height":70.000000,"length":80.000000,"weight":63.200001,"platform":"platform04","order":106,"material":"","type":1,"place":100},{"boxId":"94267810103S369","x":-43.900002,"y":-25.000000,"z":539.000000,"width":48.000000,"height":70.000000,"length":80.000000,"weight":63.200001,"platform":"platform04","order":107,"material":"","type":1,"place":100},{"boxId":"94267810103T711","x":-91.900002,"y":45.000000,"z":459.000000,"width":48.000000,"height":70.000000,"length":80.000000,"weight":63.000000,"platform":"platform04","order":108,"material":"","type":1,"place":100},{"boxId":"94267810103T720","x":-43.900002,"y":45.000000,"z":459.000000,"width":48.000000,"height":70.000000,"length":80.000000,"weight":63.000000,"platform":"platform04","order":109,"material":"","type":1,"place":100},{"boxId":"94267810103T721","x":-91.900002,"y":45.000000,"z":539.000000,"width":48.000000,"height":70.000000,"length":80.000000,"weight":63.000000,"platform":"platform04","order":110,"material":"","type":1,"place":100},{"boxId":"94267810103T708","x":-43.900002,"y":45.000000,"z":539.000000,"width":48.000000,"height":70.000000,"length":80.000000,"weight":62.799999,"platform":"platform04","order":111,"material":"","type":1,"place":100}]';
			var jsonstr2 = '{"container_length":1192.000000,"container_width":231.800003,"container_height":260.000000,"container_max_load":23000.000000,"container_type_name":"40HQ"}'
            var objectArray= JSON.parse(jsonstr);
			var truckJsonObj = JSON.parse(jsonstr2);
            var container, stats;
            var camera, controls, scene, projector, renderer;
            var objects = [], plane;
            var mouse = new THREE.Vector2(), offset = new THREE.Vector3(), INTERSECTED, SELECTED; 
            init();
            animate();
            function init() {
                container = document.createElement( 'div' );
                document.body.appendChild( container );
                camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 1, 10000 );
                camera.position.x = -600;
                camera.position.y = 400;
                camera.position.z = 1000;
                controls = new THREE.TrackballControls( camera );
                controls.rotateSpeed = 1.0;
                controls.zoomSpeed = 1.2;
                controls.panSpeed = 0.8;
                controls.noZoom = false;
                controls.noPan = true;
                controls.staticMoving = false;
                controls.dynamicDampingFactor = 0.3;
                scene = new THREE.Scene();
                var ambientLight = new THREE.AmbientLight( Math.random() *0xffffff );
                scene.add( ambientLight );
                var directionalLight = new THREE.DirectionalLight( Math.random() * 0xffffff );
                directionalLight.position.set( 0, 1, 0 );
                scene.add( directionalLight );
                var pointLight = new THREE.PointLight( 0xff0000, 1, 500 );
                pointLight.position.set( 0, 0, -200 );
                scene.add( pointLight );

                container_length = truckJsonObj.container_length;
                container_width = truckJsonObj.container_width;
                container_height = truckJsonObj.container_height;
                var cube_1 = new THREE.Mesh(
                    new THREE.BoxGeometry( container_width, container_height, container_length, 1,1,1 ), 
                    new THREE.MeshBasicMaterial( { color:0xefb73e, wireframe:true } )
                );
                cube_1.position.x = 0;
                cube_1.position.y = 0;
                cube_1.position.z = 0;
                scene.add( cube_1 );

                truck_head_length = 145;
                var truck_head_1 = new THREE.Mesh(
                    new THREE.BoxGeometry( 200, 100, truck_head_length, 1, 1, 5 ), 
                    new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe:true } )
                );
                truck_head_1.position.x = 0;
                truck_head_1.position.y = -50;
                truck_head_1.position.z = -(container_length/2 + truck_head_length/2);
                scene.add( truck_head_1 );
                
                truck_head_length_2 = 80;
                var truck_head_2 = new THREE.Mesh(
                    new THREE.BoxGeometry( 170, 60, truck_head_length_2, 1, 0, 5 ), 
                    new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe:true } )
                );
                truck_head_2.position.x = 0;
                truck_head_2.position.y = 30;
                truck_head_2.position.z = -(container_length/2 + truck_head_length_2/2);
                scene.add( truck_head_2 );
                
                truck_head_chimney_radius = 7;
                var truck_head_chimney1 = new THREE.Mesh(
                    new THREE.CylinderGeometry( truck_head_chimney_radius, truck_head_chimney_radius, 300, 20 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_head_chimney1.position.x = 100;
                truck_head_chimney1.position.y = 50;
                truck_head_chimney1.position.z = -(container_length/2 + truck_head_chimney_radius/2);
                scene.add( truck_head_chimney1 );
                
                var truck_head_chimney2 = new THREE.Mesh(
                    new THREE.CylinderGeometry( truck_head_chimney_radius, truck_head_chimney_radius, 300, 20 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_head_chimney2.position.x = -100;
                truck_head_chimney2.position.y = 50;
                truck_head_chimney2.position.z = -(container_length/2 + truck_head_chimney_radius/2);
                scene.add( truck_head_chimney2 );
        
                var truck_wheel_1 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_1.position.x = 110;
                truck_wheel_1.position.y = -100;
                truck_wheel_1.position.z = -(container_length/2 + truck_head_length_2/2 + 20) ;
                truck_wheel_1.rotation.x = 0;
                truck_wheel_1.rotation.y = 0;
                truck_wheel_1.rotation.z = 1.6;
                scene.add( truck_wheel_1 );
                
                var truck_wheel_2 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_2.position.x = -110;
                truck_wheel_2.position.y = -100;
                truck_wheel_2.position.z = -(container_length/2 + truck_head_length_2/2 + 20);
                truck_wheel_2.rotation.x = 0;
                truck_wheel_2.rotation.y = 0;
                truck_wheel_2.rotation.z = 1.6;
                scene.add( truck_wheel_2 );

                offset_2 = -240;
                var truck_wheel_5 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_5.position.x = container_width/2 + 5;
                truck_wheel_5.position.y = -100;
                truck_wheel_5.position.z = (container_length/2 + truck_head_length_2/2 + offset_2) ;
                truck_wheel_5.rotation.x = 0;
                truck_wheel_5.rotation.y = 0;
                truck_wheel_5.rotation.z = 1.6;
                scene.add( truck_wheel_5 );

                var truck_wheel_6 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_6.position.x = -container_width/2 - 5;
                truck_wheel_6.position.y = -100;
                truck_wheel_6.position.z = (container_length/2 + truck_head_length_2/2 + offset_2);
                truck_wheel_6.rotation.x = 0;
                truck_wheel_6.rotation.y = 0;
                truck_wheel_6.rotation.z = 1.6;
                scene.add( truck_wheel_6 );

                for (var i in objectArray) {
                    if (objectArray[i].type==2) {
						var cylinderTopR = objectArray[i].length / 2;
						var cylinderHeight = objectArray[i].height;
						if (objectArray[i].place == 1 || objectArray[i].place == 2)
						{
							cylinderHeight = objectArray[i].width;
						}
						
                        var object2 = new THREE.Mesh(
						    new THREE.CylinderGeometry(cylinderTopR, cylinderTopR, cylinderHeight, 60),
                            new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff , wireframe:false } ) 
                        ); 
                        object2.position.x = objectArray[i].x;
                        object2.position.y = objectArray[i].y;
                        object2.position.z = objectArray[i].z;
                        if (objectArray[i].place==1) {
                            object2.rotation.z = 55;
                        }
                        if (objectArray[i].place==2) {
                            object2.rotation.x = 55;
                        }
                        object2.width = objectArray[i].width;
                        object2.height = objectArray[i].height;
                        object2.length = objectArray[i].length;
                        object2.weight = objectArray[i].weight;
                        object2.platform = objectArray[i].platform;
                        object2.order = objectArray[i].order;
                        object2.materialInfo = objectArray[i].material;
                        object2.boxId = objectArray[i].boxId;
                        object2.type = objectArray[i].type;
                        object2.place = objectArray[i].place;
                        scene.add( object2 );
                        objects.push( object2 );
                    }
                    if (objectArray[i].type==1) {
						if (objectArray[i].place == 200)
						{
							var box_length = objectArray[i].width;
                            var box_width = objectArray[i].length;
						}
						else
						{
							var box_length = objectArray[i].length;
							var box_width = objectArray[i].width;
						}
						var box_height = objectArray[i].height;
                        var object = new THREE.Mesh(
                            new THREE.BoxGeometry( box_width, box_height, box_length, 1, 1, 1 ), 
                            new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff , wireframe:false } ) 
                        ); 
                        object.position.x = objectArray[i].x;
                        object.position.y = objectArray[i].y;
                        object.position.z = objectArray[i].z;
						object.length = objectArray[i].length;
						object.width = objectArray[i].width;
						object.height = objectArray[i].height;
                        object.weight = objectArray[i].weight;
                        object.platform = objectArray[i].platform;
                        object.order = objectArray[i].order;
                        object.materialInfo = objectArray[i].material;
                        object.boxId = objectArray[i].boxId;
                        object.type = objectArray[i].type;
                        object.place = objectArray[i].place;
                        scene.add( object );
                        objects.push( object );
                    }
                }

                plane = new THREE.Mesh(
                    new THREE.PlaneGeometry( 2000, 2000, 8, 8 ),
                    new THREE.MeshBasicMaterial( { color: 0x000000, opacity: 0.25, transparent: true, wireframe: true } )
                );
                plane.visible = true;
                scene.add( plane );
                projector = new THREE.Projector();
                renderer = new THREE.WebGLRenderer( { antialias: true } );
                renderer.sortObjects = false;
                renderer.setSize( window.innerWidth, window.innerHeight );
                renderer.shadowMapEnabled = true;
                renderer.shadowMapType = THREE.PCFShadowMap;
                container.appendChild( renderer.domElement );

                stats = new Stats();
                stats.domElement.style.position = 'absolute';
                stats.domElement.style.top = '0px';
                container.appendChild( stats.domElement );

                window.addEventListener( 'resize', onWindowResize, false );
                renderer.domElement.addEventListener( 'mousemove', onDocumentMouseMove, false );
                renderer.domElement.addEventListener( 'mousedown', onDocumentMouseDown, false );
                renderer.domElement.addEventListener( 'mouseup', onDocumentMouseUp, false );
            }

            function onDocumentMouseMove( event ) {
                event.preventDefault();
                mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1;
                mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1;
                var vector = new THREE.Vector3( mouse.x, mouse.y, 0.5 );
                projector.unprojectVector( vector, camera );
                var raycaster = new THREE.Raycaster( camera.position, vector.sub( camera.position ).normalize() );
                var intersects = raycaster.intersectObjects( objects );
                if ( intersects.length > 0 ) {
                    if ( INTERSECTED != intersects[ 0 ].object ) {
                        INTERSECTED = intersects[ 0 ].object;
                        plane.position.copy( INTERSECTED.position );
                        plane.lookAt( camera.position );
                    }
                    container.style.cursor = 'pointer';
                } else {
                    container.style.cursor = 'auto';
                }
            }

            function onDocumentMouseDown( event ) {
                event.preventDefault();
                var vector = new THREE.Vector3( mouse.x, mouse.y, 0.5 );
                projector.unprojectVector( vector, camera );
                var raycaster = new THREE.Raycaster( camera.position, vector.sub( camera.position ).normalize() );
                var intersects = raycaster.intersectObjects( objects );
                if ( intersects.length > 0 ) {
                    controls.enabled = false;  
                    SELECTED = intersects[ 0 ].object;
                    var info = '<B>' + 
                        'boxId: ' + SELECTED.boxId +
                        '</br> x: ' + SELECTED.position.x + 
                        '</br> y: ' + SELECTED.position.y + 
                        '</br> z: ' + SELECTED.position.z + 
                        '</br> width: ' + SELECTED.width + 
                        '</br> height: ' + SELECTED.height + 
                        '</br> length: ' + SELECTED.length + 
                        '</br> weight: ' + SELECTED.weight +
                        '</br> platform: ' + SELECTED.platform +
                        '</br> order: ' + SELECTED.order +
                        '</br> material: ' + SELECTED.materialInfo + 
                        '</br> type: ' + SELECTED.type + 
                        '</br> place: ' + SELECTED.place + 
                        '</B>' +
                        '</br>' + 
                        '--------------------------' + 
                        '</br>' +
                        'type(1:箱体 2:圆柱体)' +
                        '</br>' +
                        'place(1:品字型 2:田字型)';
                    $("#objectInfo").html(info);
                }
            }

            function onDocumentMouseUp( event ) {
                event.preventDefault();
                controls.enabled = true;
                if ( INTERSECTED ) {
                    plane.position.copy( INTERSECTED.position );
                    SELECTED = null;
                }
                container.style.cursor = 'auto';
            }

            function onWindowResize() {
                camera.aspect = window.innerWidth / window.innerHeight;
                camera.updateProjectionMatrix();
                renderer.setSize( window.innerWidth, window.innerHeight );
            }

            function animate() {
                requestAnimationFrame( animate );
                render();
                stats.update();
            }

            function render() {
                controls.update();
                renderer.render( scene, camera );
            }

        </script>
        <div id="objectInfo" class="a2"><br/>点击物体获取相关属性</div>
        <style>
            .a2{position:absolute; left:20px; top:50px; bottom:0px; width:180px; height:250px; z-index:9999; background: #00FFFF; font-weight:bold; }
        </style>
    </body>
</html>